<?php

namespace app\jok\controller;

use app\common\logic\commonLogic;
use app\common\logic\systemAuthLogic;
use think\Controller;

class Index extends Controller
{
    public function index()
    {
        echo 'Meteor YYDS';
        // (new \app\jok\logic\jokCommonLogic)->checkToken();
    }
    public function getAuth()
    {
        $auid = request()->param('auid', 0);
        $systemAuthLogic = new systemAuthLogic;
        $list = $systemAuthLogic->getAuthList($auid);
        return json($list);
    }
    public function getSelect()
    {
        $type = request()->param('type', '');
        $result = [];
        if (!empty($type)) {
            $arr = explode(',', $type);
            if (count($arr) == 1) {
                $result[$arr[0]] = commonLogic::selectData($arr[0]);
            } else {
                foreach ($arr as $k => $v) {
                    $result[$v] = commonLogic::selectData($v);
                }
            }
        }
        return json(['code' => 1, 'data' => $result]);
    }

    public function notRoute()
    {
        echo '404 notRoute1';
    }
}
